home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swaga_c.zip / COMM.SWG / 0062_Reading the Fossil Name and Version.pas < prev    next >
Pascal/Delphi Source File  |  1995-03-03  |  1KB  |  62 lines

  1. {
  2. > We can me tell, how i can read the name of the fossil-driver and version
  3. > number of the fossil-driver ?
  4. }
  5. program
  6.   whothere;
  7.  
  8. uses
  9.   dos;
  10.  
  11. function fossilname(fport : byte) : string;
  12. type
  13.   fossilrec = record
  14.     strsize : word;
  15.     majrev  : byte;
  16.     minver  : byte;
  17.     idofs   : word;
  18.     idseg   : word;
  19.     ibuff   : word;
  20.     ifree   : word;
  21.     obuff   : word;
  22.     ofree   : word;
  23.     swidth  : byte;
  24.     sheight : byte;
  25.     dte     : byte;
  26.   end;
  27. var
  28.   regs : registers;
  29.   fosinfo : fossilrec;
  30.   fosname : string[78];
  31.   i : byte;
  32. begin
  33.   regs.ah := $04;
  34.   regs.dx := fport;
  35.   intr($14, regs);
  36.   if regs.ax <> $1954 then begin
  37.     writeln('Unable to detect FOSSIL driver');
  38.     halt;
  39.   end;
  40.   regs.ah := $1b;
  41.   regs.cx := sizeof(fosinfo);
  42.   regs.dx := fport;
  43.   regs.es := seg(fosinfo);
  44.   regs.di := ofs(fosinfo);
  45.   intr($14, regs);
  46.   if fosinfo.majrev <> 5 then begin
  47.     writeln('FOSSIL is not Rev5 compatible');
  48.     halt;
  49.   end;
  50.   fosname := '';
  51.   i := 0;
  52.   repeat
  53.     fosname := fosname+chr(mem[fosinfo.idseg:fosinfo.idofs+i]);
  54.     inc(i);
  55.   until(mem[fosinfo.idseg:fosinfo.idofs+i] = 0);
  56.   fossilname := fosname;
  57. end;
  58.  
  59. begin
  60.   writeln('Fossil name COM4=', fossilname(3));
  61. end.
  62.